package com.example.bigevent.init;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.data.redis.core.StringRedisTemplate;

public class MyApplicationListener implements ApplicationListener {



    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof ApplicationReadyEvent) {
            //System.out.println("初始化成功");

        }

        if (event instanceof ApplicationFailedEvent) {
           // System.out.println("初始化失败了");

        }


    }
}
